﻿<!--#include file="h.asp"--><%
'
'	七色虎建站系统
'	公告页面
'	2012.4.5

Sub main
	Dim rs,id,body_,sql
	id=getN("id",1)
	body_ = ""
	If Request.QueryString("action")="view" Then
		hu.title = "查看公告"
		body_ = body_ & checkMsg()'信息
		body_ = body_ & "[div=nav]-" & hu.url("?aid=index","首页") & "-" & hu.url("report.asp", "公告")& "-正文[/div]"
		Set rs=hu.conn( "select  * from 74hu_gonggao where id="&id&" order by id desc")
		If Not rs.eof Then
			body_ = body_ & "[div=tle]"&nowml(rs("name"))&"[/div]["&fordate(rs("HU_time"))&"]<br/>"&ubbCode(rs("title"))&"<br/>"
		Else
			body_ = body_ & "没有这个公告！"
		end if
		body_ = body_ & "<br/>" & hu.url("report.asp", "返回公告中心") & "<br/>"
		Rs.close
		set Rs=nothing
	Else
		hu.title = "最新公告"
		body_ = body_ & checkMsg()'信息
		sql = "select id,name from 74hu_gonggao order by id desc"
		Set rs = Server.CreateObject("ADODB.Recordset")
		rs.open sql, hu.db, 1, 1
		If Not rs.eof Then
			Dim PageSize,Count,page,i,pagecount,class_
			PageSize=10
			count = rs.recordcount
			page=getN("page",1)
			if page<1 then page=1
			page=int(page)
			if page<=0 or page="" then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			body_ = body_ & "[div=nav]-" & hu.url("?aid=index", "首页") &"-公告中心[/div]共("&count&")条公告<br/>"
			For i=1 To PageSize
				If rs.eof Then Exit For
				If i mod 2 = 0 Then
					class_="even"
				Else
					class_="odd"
				End If
				body_ = body_ & "[div="&class_&"]" & hu.url("report.asp?action=view&amp;id="&rs("id"), (i+(page-1)*PageSize)&"."&nowml(Rs("name")))&"[/div]"
				rs.moveNext
			Next
			body_ = body_ &  showPage("report.asp", "", page, pagecount)&"<br/>"
		Else
			body_ = body_ &  "暂时没有公告！<br/>"
		end if
		Rs.close
		set Rs=nothing
	End If
	hu.body = comUbb(body_)
End Sub

%>